package cn.bjnangle.mytrack;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.media.AudioManager;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import androidx.annotation.Nullable;

public class MainActivity extends Activity implements View.OnClickListener {
    private AudioManager mAudioManager;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main1);
        findViewById(R.id.Server).setOnClickListener(this);
        findViewById(R.id.Client).setOnClickListener(this);
        mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
        int sysMaxVolme = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_VOICE_CALL);
        Log.e("main","-----"+sysMaxVolme);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.Server:
                Intent intent = new Intent(MainActivity.this,EchoUDPServer.class);
                startActivity(intent);
                break;
            case R.id.Client:
                Intent intent2 = new Intent(MainActivity.this,EchoUDPClient.class);
                startActivity(intent2);
                break;
        }
    }
}
